package com.njtoyo.taxi.admin.mapper.master.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.DriverRegionServiceArrangement;
import com.njtoyo.taxi.admin.mapper.master.enums.DriverRegionServiceArrangementCategory;
import com.njtoyo.taxi.admin.rest.presenter.business.operation_rule.DriverServiceArrangementPresenter;
import com.njtoyo.taxi.admin.rest.wrapper.business.operation_rule.DriverServiceArrangementWrapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 司机区域安排表 Mapper 接口
 * </p>
 *
 * @author Dell
 * @since 2021-11-04
 */
@Repository
@DS(Const.PRIMARY_DS)
public interface DriverRegionServiceArrangementMapper extends BaseMapper<DriverRegionServiceArrangement> {
    List<DriverRegionServiceArrangement> getListByCategory(@Param("category") DriverRegionServiceArrangementCategory category);

    boolean markingRuleIsOpen(@Param("driverRegionId") Long driverRegionId);

    IPage<DriverServiceArrangementPresenter> selectPage(DriverServiceArrangementWrapper wrapper);

    DriverServiceArrangementPresenter selectDetailById(Long id);

    DriverRegionServiceArrangement selectByCategoryAndDriverRegionId(@Param("category") DriverRegionServiceArrangementCategory category, @Param("driverRegionId") Long driverRegionId);
    
    DriverRegionServiceArrangement selectByCategoryAndId(@Param("category") DriverRegionServiceArrangementCategory category, @Param("id") Long id);

    IPage<DriverRegionServiceArrangement> getPages(Page<DriverRegionServiceArrangement> page, @Param("wrapper") DriverRegionServiceArrangement wrapper);
}
